<?php
namespace app\admin\validate;
use think\Validate;
use think\Db;
class VideoValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'vid'=>'checkId',
        'vname'=>'require|max:50',
        'message'=> 'require',
        'vimg'=> 'require',
        'videourl'=>'require',
        'goods'=>'require',
        'showtype'=>'require|number'
    ];
    //错误信息
    protected $message  = [
        'vname.require'                 => '请填写商品名字',
        'vname.max'                     => '商品名字小于50字符',
        'message.require'                  => '请填写视频介绍',
        'vimg.require'                 => '请上传默认播放图片',
        'videourl'            => '上传视频',
        'goods.require'            => '请选择一个商品',
        'showtype.require'              => '请选择显示类型',
        'showtype.number'         => '显示类型为数字'
    ];
    
	protected function checkId($value, $rule ,$data)
    {
        return true;
    }
}